package match;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;

public class FileIO {

	public static void main(String args[]) throws IOException
	{
		for(int i=0;i<100;i++)
		{
			RecordFaceLog("imgpath","imagepath2","male","23","70.8","98.0","normal","0");
		}
	}
	
	private static void RecordFaceLog(String FromImg,String FileImg,String sex,String age,String smile,String quality,String glassess,String matchtimes) throws IOException
	{
		
		FileWriter fw=new FileWriter("d:\\test\\data.txt",true);
		fw.write(FromImg+" "+FileImg+" "+sex+" "+age+" "+smile+" "
				+quality+" "+glassess+" "+matchtimes+";");
		fw.close();
	}
	private static int getScore(Cutface face1,Cutface face2)
	{
		int score=0;
		if(face1.Sex!=face2.Sex)
			score+=25;
		score+=Math.abs(20-Math.abs(face1.Age-face2.Age));
		score+=30-Math.abs(face1.Smile-face2.Smile)/3;
		score+=10-Math.abs(face1.Quality-face2.Quality)/10;
		if(face1.Glassess==face2.Glassess)
			score+=15;
		return score;
	}
	private class Cutface
	{
		String FromImg;
		String FileImg;
		String Sex;
		int Age;
		double Smile;
		double Quality;
		String Glassess;
		int Matchtimes;
	}
}
